# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=openxr
pkgver=1.0.32
pkgrel=0
pkgdesc="OpenXR loader library"
url="https://khronos.org/openxr"
arch="all"
license="Apache-2.0"
makedepends="cmake mesa-dev vulkan-loader-dev jsoncpp-dev samurai wayland-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/KhronosGroup/OpenXR-SDK/archive/release-$pkgver.tar.gz"
builddir="$srcdir/OpenXR-SDK-release-$pkgver"
options="!check" # no check available

build() {
	case "$CARCH" in
		armhf)
			export CXXFLAGS="$CXXFLAGS -D_M_ARM" ;;
	esac

	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=Release
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
2b5b1a485683572b79260ff06496b5787a0729765ecb9a819aa61f96f4d2a76eb9bb78f7d6f161c328e4ade5eae5c3aa45d125a5c175d565dd327431a5020c01  openxr-1.0.32.tar.gz
"
